package xyz.zdsoft.homework_manage_module.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import xyz.zdsoft.homework_manage_module.bo.QueryHomework;
import xyz.zdsoft.homework_manage_module.vo.RestEnclosure;
import xyz.zdsoft.homework_manage_module.vo.RestPerTask;
import xyz.zdsoft.homework_manage_module.vo.RestQueryHomework;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface TeacherOperationMapper {
   List<RestQueryHomework> QueryHomework(QueryHomework queryHomework,String teacherName,String type,String types);
   @Select("SELECT create_time,title,complete_date,appends_link,teacher_name FROM `wrok_job_view`  WHERE id=#{id}")
   RestPerTask PersonalTask(@Param("id")Integer id);
   @Select("SELECT file_url,file_name FROM attachement WHERE origin_type=#{type} AND origin_id=#{workId}")
   List<RestEnclosure>  Enclosure(@Param("workId") Long workId,@Param("type") String type);

   @Update("UPDATE work_submit_info set score=#{score}, teacher_remark=#{teacher_remark}  WHERE id=#{id}")
   boolean ApprovalWork(@Param("id")Integer id,@Param("score") float score, @Param("teacher_remark")String teacher_remark);

}
